// file: com/miui/theme/custom/ui/theme/AppColors.kt

package com.miui.theme.custom.ui.theme

import androidx.compose.runtime.Composable
import androidx.compose.runtime.Immutable
import androidx.compose.ui.graphics.Color

/**
 * 一个不可变的数据类，用于存储应用程序的颜色配置。
 * 完全由 Kotlin 定义，不再依赖 XML。
 */
@Immutable
data class AppColors(
    val primary: Color,
    val textPrimary: Color,
    val textSecondary: Color,
    val textHint: Color,
    val background: Color,
    val backgroundLight: Color,
    val backgroundDark: Color,
    val absoluteWhite: Color,
    val absoluteBlack: Color,
    val white: Color,
    val white12: Color,
    val white56: Color,
    val white70: Color,
    val black: Color,
    val gray21: Color,
    val bug: Color,
    val dark: Color,
    val dragon: Color,
    val electric: Color,
    val fairy: Color,
    val fire: Color,
    val fighting: Color,
    val flying: Color,
    val ghost: Color,
    val steel: Color,
    val ice: Color,
    val poison: Color,
    val psychic: Color,
    val rock: Color,
    val water: Color,
    val grass: Color,
    val ground: Color,
    val orange: Color,
    val green: Color,
    val blue: Color
) {
    companion object {
        /**
         * 提供暗色主题的默认颜色。
         * 直接使用在 Color.kt 中定义的常量。
         */
        @Composable
        fun defaultDarkColors(): AppColors = AppColors(
            primary = Primary,
            textPrimary = TextPrimaryDark,
            textSecondary = TextSecondaryDark,
            textHint = TextHintDark,
            background = Color(0xFF000000), // 用户指定的纯黑背景
            backgroundLight = Color(0xFF1C1C1E), // 深色卡片背景
            backgroundDark = Color(0xFF121212), // 更深的背景层次
            absoluteWhite = AbsoluteWhite,
            absoluteBlack = AbsoluteBlack,
            white = AbsoluteBlack,
            white12 = AbsoluteWhite.copy(alpha = 0.12f),
            white56 = AbsoluteWhite.copy(alpha = 0.56f),
            white70 = AbsoluteWhite.copy(alpha = 0.70f),
            black = AbsoluteWhite,
            gray21 = Gray21,
            bug = Bug,
            dark = Dark,
            dragon = Dragon,
            electric = Electric,
            fairy = Fairy,
            fire = Fire,
            fighting = Fighting,
            flying = Flying,
            ghost = Ghost,
            steel = Steel,
            ice = Ice,
            poison = Poison,
            psychic = Psychic,
            rock = Rock,
            water = Water,
            grass = Grass,
            ground = Ground,
            orange = Orange,
            green = Green,
            blue = Blue
        )

        /**
         * 提供亮色主题的默认颜色。
         * 直接使用在 Color.kt 中定义的常量。
         */
        @Composable
        fun defaultLightColors(): AppColors = AppColors(
            primary = Primary,
            textPrimary = TextPrimaryLight,
            textSecondary = TextSecondaryLight,
            textHint = TextHintLight,
            background = Color(0xFFF7F7F7), // 用户指定的 #F7F7F7 背景
            backgroundLight = AbsoluteWhite, // 浅色卡片背景
            backgroundDark = Color(0xFFEFEFF4), // 更深的背景层次
            absoluteWhite = AbsoluteWhite,
            absoluteBlack = AbsoluteBlack,
            white = AbsoluteWhite,
            white12 = AbsoluteBlack.copy(alpha = 0.12f),
            white56 = AbsoluteBlack.copy(alpha = 0.56f),
            white70 = AbsoluteBlack.copy(alpha = 0.70f),
            black = AbsoluteBlack,
            gray21 = Gray21,
            bug = Bug,
            dark = Dark,
            dragon = Dragon,
            electric = Electric,
            fairy = Fairy,
            fire = Fire,
            fighting = Fighting,
            flying = Flying,
            ghost = Ghost,
            steel = Steel,
            ice = Ice,
            poison = Poison,
            psychic = Psychic,
            rock = Rock,
            water = Water,
            grass = Grass,
            ground = Ground,
            orange = Orange,
            green = Green,
            blue = Blue
        )
    }
}